Today we will discuss Regular Expressions (which you might have heard of if you’re a programmer), their relation to Regular Languages, and the Pumping Lemma. This will conclude our discussion of Automata and we can then move onto more complex and interesting models of Computation.
Regular Languages
Def: A language is a regular language if there exists some finite automata that recognizes it.
Easy enough, no? That means that all the languages that we were working with in the last two entries were actually Regular Languages.
You’ve probably heard of Regular Expressions if you’re a programmer. They’re a great way of working with text, and save a lot of time. In our context, we will consider the effects of three specific Regular Operations on Languages (sets of strings of words). The operations are:
- Union.
or 
- Concatenation.
and 
- Star.
. Note here that the condition
means that
could equal zero.
Pretty simple, right? Well, it turns out that the Regular Languages have an interesting property: they are closed under Regular Operations. That means that, if you had regular languages A and B, and did some combination of Regular Operations on them, the result would be a langauge C that you 100% sure could find a Finite Automata for. Let’s go through these one by one.
Union. We wish to show that, given regular languages A and B the union of them is also regular. Because they are regular, there exists DFAs
and
that recognize them respectively. Consider the sets of states of these machines,
and
. We construct a machine with states
. The behavior of this should be natural, then. The start state will be
, the transition function is defined
. The accept states are the set
, where at least one of
or
were accept states for their respective machines. Given a string then, this machine will “simulate” both
and
on the word, and accept if one of those accepts.
Concatenation. This is easy with the use of nondeterminism. Given machines
and
, we construct an NDA
that accepts
. The construction of
is easier to visualize with a graphical depiction, so we will forgo the formalism of the earlier proofs. Basically, take
and
, and have nondeterministic
-transitions from the accept states of
to the start state of
. That way, each time we reach a word in
, we nondeterministically branch to check if either the rest of the string is in
, or if we should go on further. Moreover, the only accept states are the accept states of
. It is noted that the original state transitions of
and
are conserved here as well.
Star Operation. We use nondeterminism here as well. Start with the deterministic machine
that accepts the language. We first make it a nondeterministic machine, then add a new start state that points to the start state of the former machine (denoted
). The new start state is an accept state to account for the fact that the star operation includes the empty string. Also, the start state has an
-transition to
, so that we can effectively simulate
on the input. We keep the accept states of
, and add
-transitions to
(can you see why?).
The three constructions above show the closure of the regular operations. In addition, the proofs should show you a little about how nice nondeterminism can be when trying to solve a problem. Anyway, now that we know more about regular languages, we can state the Pumping Lemma, which is used to show when a language is nonregular.
Pumping Lemma: If
is a regular language, there exists
a positive integer where for any string
of length greater than
,
may be written as the concatenation of strings
where:
- For any
, 


I’m not going to prove this lemma, but it has to do with the finite number of states that Automata have. If you want to try that for an exercise, it shouldn’t be difficult - just make sure you’re being rigorous. Also, I would like to emphasize that the number
is a fixed number specific to the language.
Anyway! That’s all I really want to say about finite automata. We’ll start learning about everyone’s favorite model of computation - the Turing Machine - next entry. But for now, why don’t you try these problems to check your understanding of the bit we just learned?
- Show that the following language is not regular: 
- Let
a binary number that is a multiple of
. Show that for each
, the language is regular.